]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
src/shell: Plug some small leaks
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 01:30:48 +0000 (03:30 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 13:16:54 +0000 (15:16 +0200)
Spotted by coverity in CID 351284 and 351288.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>

src/shell-global.c
src/shell-perf-log.c

index 49ff2d7ddf0add9571644d4fd4780c904fcffb02..e8705f5b08c757bf1da58933c56fd306ea9ddaeb 100644 (file)
@@ -1249,7 +1249,7 @@ shell_global_reexec_self (ShellGlobal *global)
   char *buf;
   char *buf_p;
   char *buf_end;
-  GError *error = NULL;
+  g_autoptr (GError) error = NULL;
 
   if (!g_file_get_contents ("/proc/self/cmdline", &buf, &len, &error))
     {
index 95b116905fa32aa3e8b970146216e804052c4ade..3bd5228a015c6ef77076459640144bdf1adef68a 100644 (file)
@@ -862,7 +862,7 @@ replay_to_json (gint64      time,
                 gpointer    user_data)
 {
   ReplayToJsonClosure *closure = user_data;
-  char *event_str;
+  g_autofree char *event_str = NULL;
 
   if (closure->error != NULL)
     return;